<template>
  <div>
<!--  页面头部  -->
    <el-container>
      <el-header>
    <el-page-header @back="goBack" content="买入股票">
    </el-page-header>
      </el-header>
    </el-container>
  <el-row>
    <el-col :span="12"><div class="grid-content bg-purple">
        <div class="form-purchase">
          <el-form ref="form" :model="form" label-width="115px">
            <el-form-item label="证券代码">
              <el-input v-model="form.name" placeholder="股票代码/简称"></el-input>
            </el-form-item>
            <el-form-item label="证券名称">
              <el-input v-model="form.name"></el-input>
            </el-form-item>
            <el-form-item label="可买（股）">
              <el-input v-model="form.name"></el-input>
            </el-form-item>
            <el-form-item label="价格">
              <el-input-number
                  v-model="form.money"
                  controls-position="right"
                  @change="handleChange"
                  style="width: 435px;"
                  :min="1">
              </el-input-number>
            </el-form-item>
            <el-form-item label="买入（股）">
              <el-input-number
                  v-model="form.entrustNum"
                  controls-position="right"
                  @change="handleChange"
                  style="width: 435px;"
                  :min="1">
              </el-input-number>
            </el-form-item>
            <el-form-item>
              <el-button type="primary" @click="save">买入</el-button>
              <el-button>取消</el-button>
            </el-form-item>
          </el-form>
        </div>

      </div>

    </el-col>
    <el-col :span="12"><div class="grid-content bg-purple-light"></div></el-col>
  </el-row>
  </div>
</template>

<script>
export default {
  name: "index",
  data() {
    return {
      form: {}
    }
  },
  methods:{
    save(){
      this.axios.post("http://localhost:8005/entrust/save",this.form).then(r=>{
        this.$message.success("委托成功");
        this.$router.push("/entrust");
      })
    },
  }
}
</script>

<style scoped>
.form-purchase{
  width: 550px;
  margin: 0 auto;
}

</style>